Fix double free in ostree_repo_pull_with_options
authorJohn Hiesey <john@hiesey.com>
Wed, 6 May 2015 23:43:06 +0000 (16:43 -0700)
committerColin Walters <walters@verbum.org>
Fri, 5 Jun 2015 21:27:38 +0000 (17:27 -0400)
Duplicate the commit checksum for expected_commit_sizes since it's also
used as a value in requested_refs_to_fetch.

https://bugzilla.gnome.org/show_bug.cgi?id=750366

src/libostree/ostree-repo-pull.c

index 608a7b4ff8e25944e8a8f9b274861c93b55b686d..cf576b5ad7f8d642c613c7c305b24755157e0ec5 100644 (file)
@@ -2063,7 +2063,7 @@ ostree_repo_pull_with_options (OstreeRepo             *self,
 
           malloced_size = g_new0 (guint64, 1);
           *malloced_size = commit_size;
-          g_hash_table_insert (pull_data->expected_commit_sizes, contents, malloced_size);
+          g_hash_table_insert (pull_data->expected_commit_sizes, g_strdup (contents), malloced_size);
         }
       else
         {